<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type">
    <meta charset="utf-8">
    <title>订单详情</title>
    <style>
        <!--

        /* 内容部分通用表格样式 */
        .ncm-default-table { line-height:20px; width: 100%; border-collapse: collapse; clear: both;}
        .ncm-default-table thead th { color: #999; background-color: #FFF; text-align:center; height: 20px; padding: 8px 0; border-bottom: solid 1px #E7E7E7; }
        .ncm-default-table th {color: #666;font-size: 13px;text-align:left;padding: 20px 0;}
        .ncm-default-table thead td,
        .ncm-default-table tfoot th { background-color: #FFF; height: 20px; padding: 5px 0; border-bottom: solid 1px #E7E7E7;}
        .ncm-default-table tfoot th { border-top: solid 1px #E6E6E6;}
        .ncm-default-table thead td .checkall,
        .ncm-default-table tfoot th .checkall { vertical-align: middle; display: inline-block; *display: inline/*IE7*/; margin: 0 4px 0 8px; *zoom: 1;}
        .ncm-default-table thead td label,
        .ncm-default-table tfoot th label { color: #777; vertical-align: middle; display: inline-block; *display: inline/*IE7*/; margin-right: 10px; cursor: pointer; *zoom:1;}
        .ncm-default-table tbody th { background-color: #FAFAFA; border: solid #E6E6E6; border-width: 1px 0; padding: 4px 0;}
        .ncm-default-table tbody th span { display: inline-block; vertical-align: middle; margin-right: 30px;}
        .ncm-default-table tbody th span.goods-name { text-overflow: ellipsis; white-space: nowrap; width: 240px; height: 20px; overflow: hidden;}
        .ncm-default-table tbody th a.share-goods { float: right; margin-right: 10px; color: #999;}
        .ncm-default-table tbody th a:hover.share-goods { color: #333; text-decoration: none;}
        .ncm-default-table tbody th a.share-goods i { vertical-align: middle;}
        .ncm-default-table tbody th a.order-trash { float: right; margin-right: 10px; color: #999; padding-right: 10px; border-right: solid 1px #DDD; margin-right: 10px;}
        .ncm-default-table tbody th a:hover.order-trash { color: #F33; text-decoration: none;}
        .ncm-default-table tbody th a.order-trash i { font-size: 14px; vertical-align: middle;}

        .ncm-default-table tbody td { color: #999; background-color: #FFF; text-align: center; padding: 10px 0;}
        .ncm-default-table tbody tr.bd-line td { border-bottom: solid 1px #E7E7E7;}
        .ncm-default-table tbody td strong { color: #666;}
        .ncm-default-table td .pic-thumb { line-height: 0; background-color: #FFF; text-align: center; vertical-align: middle; display: table-cell; *display: block; width: 32px; height: 32px; padding: 2px; border: solid 1px #F5F5F5; overflow: hidden;}
        .ncm-default-table td .pic-thumb img { max-width: 32px; max-height: 32px; margin-top:expression(32-this.height/2); *margin-top:expression(16-this.height/2)/*IE6,7*/;}
        .ncm-default-table td .goods-name { border: none; overflow: hidden;}
        .ncm-default-table td .goods-name dt { font-size: 12px; line-height: 16px; color: #333; display: block; text-align: left; width: 100%; min-height: 16px; max-height: 32px; padding-bottom: 4px; overflow: hidden;}
        .ncm-default-table td .goods-name dt a { color: #333;}
        .ncm-default-table td .goods-name dt .rec { margin-left: 5px;}
        .ncm-default-table td .goods-name dt .rec a { color: #0279b9; }
        .ncm-default-table td .goods-name dd { line-height: 20px; display: block; max-width: 280px; height: 20px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}
        .ncm-default-table td .goods-cti { font-size: 0; *word-spacing:-1px/*IE6、7*/;}
        .ncm-default-table td .goods-cti span { vertical-align: top; letter-spacing: normal; word-spacing: normal; display: inline-block; *display: inline/*IE7*/; width: 16px; height: 16px; margin-right: 4px; *zoom: 1; }
        .ncm-default-table td .goods-cti span img { max-width: 16px; max-height: 16px;}
        .ncm-default-table td .goods-price { font-weight: 600; color: #666; background:url(../images/rmb_s.gif) no-repeat 0 3px; padding-left: 10px;}
        .ncm-default-table td .goods-type { color: #FFF; background-color: #ff875a; display: inline-block; padding: 2px 5px;}
        .td1 {font-size: 13px;color: #111 !important;}
        .td2 {font-size: 14px;color: #111 !important;}
        /* 翻页 */
        .pagination{ clear: both; margin: auto;}
        .pagination ul{ padding: 50px 0 30px 0; margin: 0; text-align: center;}
        .pagination ul li { display: inline-block; list-style-type: none;}
        .pagination ul li { *display: inline;}
        .pagination  a{font-weight:normal;}
        .pagination li span { font-size: 12px; line-height: 28px; color: #777; background-color: #FFF; list-style-type: none; display: inline; height: 28px; float: left; padding: 0px 10px; margin: 0px 1px; border:solid 1px #999899; font-weight:normal;}
        .pagination li a span , .pagination li a:visited span { color: #60B3DD; text-decoration: none; cursor:pointer;}
        .pagination li a:hover span, .pagination li a:active span{ color: #fff; background-color: #efb217; border-color: #efb217; cursor:pointer;}
        .pagination li span.currentpage { color: #fff; font-weight: 600;  background-color: #efb217; border-color: #efb217;}

        -->
    </style>
</head>
<body>
<a href="#" onClick="javascript:history.back(-1);" class="td2">返回订单列表</a>
<?php
$order_id=$_GET['order_id'];
$conn=mysql_connect("localhost","root","root");
mysql_select_db("shopwwi");
mysql_set_charset('utf8',$conn);
$sql="SELECT a.*,b.*,c.e_code,c.e_name FROM shopwwi_orders a LEFT JOIN  shopwwi_order_common b ON a.order_id=b.order_id LEFT JOIN shopwwi_express c ON b.shipping_express_id = c.id where a.order_id='".$order_id."'";
$sql2="SELECT * FROM shopwwi_order_goods where order_id='".$order_id."'";
$query=mysql_query($sql,$conn);
$query2=mysql_query($sql2,$conn);
//var_dump($sql);exit;
//$rs=mysql_fetch_array($query);
//$rs2=mysql_fetch_array($query2);
//var_dump($rs);
//var_dump($rs2);
while ($row = mysql_fetch_array($query, 1)) {
    ?>
    <table class="ncm-default-table order" style="width: 80%;margin: auto;">
        <thead>
            <tr>
                <th>订单详情</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="td1">收货地址</td>
                <td class="td1"><?php echo $row['reciver_name']?>&nbsp;&nbsp;<?php echo unserialize($row['reciver_info'])['phone'];?>&nbsp;&nbsp;<?php echo unserialize($row['reciver_info'])['address'];?></td>
            </tr>
            <tr>
                <td class="td1">订单编号</td>
                <td class="td1"><?php echo $row['order_sn']?></td>
            </tr>
            <tr>
                <td class="td1">支付方式</td>
                <td class="td1"><?php if($row['payment_code']=='online'){echo '线上支付';}elseif($row['payment_code']=='predeposit'){echo '站内余额支付';}?></td>
            </tr>
            <tr>
                <td class="td1">交易状态</td>
                <td class="td1" style="color: red !important;"><?php if($row['order_state']=='0'){echo '已取消';}elseif($row['order_state']=='10'){echo '未付款';}elseif($row['order_state']=='20'){echo '已付款';}elseif($row['order_state']=='30'){echo '已发货';}elseif($row['order_state']=='40'){echo '已收货';};?></td>
            </tr>
            <tr>
                <td class="td1">下单时间</td>
                <td class="td1"><?php if($row['add_time']){ echo date("Y-m-d h:i:s", $row['add_time']);}?></td>
            </tr>
            <tr>
                <td class="td1">付款时间</td>
                <td class="td1"><?php if($row['payment_time']){ echo date("Y-m-d h:i:s", $row['payment_time']);}?></td>
            </tr>
            <tr>
                <td class="td1">完成时间</td>
                <td class="td1"><?php if($row['finnshed_time']){ echo date("Y-m-d h:i:s", $row['finnshed_time']);}?></td>
            </tr>
            <tr>
                <td class="td1">物流公司</td>
                <td class="td1"><?php echo $row['e_name']?></td>
            </tr>
            <tr>
                <td class="td1">物流单号</td>
                <td class="td1"><?php if($row['shipping_code']){ ?><a href="http://www.jinguiyinqi.com/api/crm_order_shipping.php?no=<?php echo $row['shipping_code'];?>&code=<?php echo $row['e_code'];?>"><?php echo $row['shipping_code']?></a><?php }?></td>
            </tr>
            <tr>
                <td class="td1">商家名称</td>
                <td class="td1">金贵银器</td>
            </tr>
            <tr>
                <td class="td1">买家留言</td>
                <td class="td1"><?php echo $row['order_message'];?></td>
            </tr>
        </tbody>
    </table>
    <span class="td2">订单商品列表</span><br>
    <table class="ncm-default-table order">
        <thead>
            <tr>
                <th class="w110">商品名</th>
                <th class="w90">商品图</th>
                <th class="w90">单价（元）</th>
                <th class="w40">数量</th>
                <th class="w110">订单金额</th>
            </tr>
        </thead>
<?php
    while ($row2 = mysql_fetch_array($query2, 1)) {
?>
            <tbody>
            <tr>
                <td class="td1" title="<?php echo $row2['goods_name'];?>"><?php echo mb_substr($row2['goods_name'],'0','10','utf-8');?></td>
                <td class="td1"><img style="width: 60px;height: 60px;" src="http://www.jinguiyinqi.com/data/upload/shop/store/goods/1/<?php echo $row2['goods_image'];?>"></td>
                <td class="td1"><?php echo $row2['goods_price'];?></td>
                <td class="td1"><?php echo $row2['goods_num'];?></td>
                <td class="td1"><?php echo $row2['goods_pay_price'];?></td>
            </tr>

<?php

    }?>
</tbody>
        </table>
<?php
}
//$html='';
//foreach ($rs as $k=>$v) {
//    if ($v['order_id'] == '') continue;
//    $html.= $v['order_id'].'&nbsp;&nbsp;'.$v['buy_name'].'<br />';
//}
//echo $html;



?>



<div class="pagination">
    <ul><li><span><</span></li><li><span>></span></li></ul></div>
</body>
</html>